import Vue from "vue";
import axios from "axios";
//import { getToken } from "@/api/login"; 
Vue.use(axios)

axios.defaults.headers.common['token'] = window.localStorage.getItem('jysToken')
export const URL = 'http://39.106.251.70:8090' //39.106.251.70
//export const URL = 'http://192.168.43.38:8090'
export const http = axios.create({
        baseURL: URL,
        timeout: 8000,
        // headers:{
        //     "token":window.localStorage.getItem('jysToken')
        // 'content-type': 'application/octet-stream',
        // 'content-disposition': 'attachment;filename=' + encodeURI(fileName)
        //  }
    })
    //请求拦截器
axios.interceptors.request.use((config) => {
    // console.log(window.localStorage.getItem('jysToken'));
    // config.headers['token']=window.localStorage.getItem('jysToken')
    config.headers["Content-Type"] = "application/json";
    config.headers["content-disposition"]='attachment;filename=download.zip' 

    return config
})